<script setup lang="ts">
// 组件接口
const props = defineProps({
  loading: {
    type: Boolean,
    required: false,
    default: false,
  },
  showDataTable: {
    type: Array as PropType<strPair[]>,
    required: false,
  },
  showDataJson: {
    type: Object,
    required: false,
    default: {},
  },
});
</script>

<template>
  <el-carousel :interval="90000" height="100%" class="CarouselResView_mt-6">
    <el-carousel-item :key="1">
      <ResultViewTable
        :loading="props.loading"
        :show-data="props.showDataTable"
      />
    </el-carousel-item>
    <el-carousel-item :key="2">
      <ResultViewJson
        :loading="props.loading"
        :show-data="props.showDataJson"
      />
    </el-carousel-item>
  </el-carousel>
</template>

<style scoped>
.CarouselResView_mt-6 {
  width: 90%;
}
.el-carousel__item:nth-child(2n) {
  display: flex;
  justify-content: center;
  align-items: center;
}

.el-carousel__item:nth-child(2n + 1) {
  display: flex;
  justify-content: center;
  align-items: center;
}

.example-showcase .el-loading-mask {
  z-index: 9;
}
</style>
